<template>
  <div>
    <div class="line"></div>
    <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" @select="handleSelect">
      <el-menu-item index="1">
        <router-link to="/todo">todoList</router-link>
      </el-menu-item>
      <el-menu-item index="2">
        <router-link to="/bloglist">blog</router-link>
      </el-menu-item>
      <el-menu-item index="3">
        <router-link to="/blog">更新blog</router-link>
      </el-menu-item>
      <el-menu-item index="4">
        <router-link to="/knowledgepoint">知识点</router-link>
      </el-menu-item>
      <el-menu-item index="5">
        <router-link to="/tab">选项卡</router-link>
      </el-menu-item>
      <!-- <el-submenu index="5">
        <template slot="title">我的工作台</template>
        <el-menu-item index="2-1">选项1</el-menu-item>
        <el-menu-item index="2-2">选项2</el-menu-item>
        <el-menu-item index="2-3">选项3</el-menu-item>
      </el-submenu> -->
    </el-menu>
    <slot></slot>
  </div>
</template>

<script>
export default {
  data () {
    return {
      activeIndex: '1',
      activeIndex2: '1'
    }
  },
  methods: {
    handleSelect (key, keyPath) {
      // console.log(key, keyPath)
    }
  }
}

</script>

<style lang="less" scoped>
a {
  text-decoration: none;
}
</style>
